import { reactive } from 'vue';
import { useStore } from 'vuex';
import {
  onLoad,
  onShow
} from "@dcloudio/uni-app";

const useTest = () => {
  const store = useStore();

  const updateTest = (val, key) => {
    const obj = store.state.common.testObj;
    store.commit('updateTest', {...obj, ...val});
  }

  // onLoad(() => {
  //   updateUserInfo('李四');
  // });
  // onShow(() => {
  //   updateUserInfo('天使');
  // });
  return {
    updateTest
  }
}

export default useTest;